syntax = "proto3";

package nighthawk;

// Configuration for FakeUserDefinedOutputPlugin (plugin name: "nighthawk.fake_user_defined_output")
// that counts the number of times each api is called. Can also be programmed to return a proto
// validation failure or return an error after some number of each step.
message FakeUserDefinedOutputConfig {
  // Configures handleResponseData to fail after data_failure_countdown calls.
  bool fail_data = 1;
  // If fail_data is true, how many times handleResponseData should successfully return before
  // failing. Defaults to 0.
  int32 data_failure_countdown = 2;

  // Configures handleResponseHeaders to fail after header_failure_countdown calls.
  bool fail_headers = 3;
  // If fail_headers is true, how many times handleResponseHeaders should successfully return
  // before failing. Defaults to 0.
  int32 header_failure_countdown = 4;

  // Causes the plugin to fail on getPerWorkerOutput step.
  bool fail_per_worker_output = 5;
}

// Output proto for the FakeUserDefinedOutputPlugin.
message FakeUserDefinedOutput {
  // These fields count the number of times each api is called.
  int32 data_called = 1;
  int32 headers_called = 2;

  // Reports which worker created this plugin instance. Will say "global" for the global
  // output.
  string worker_name = 3;
}
